feat(auth): forgot/reset password flow - #23
Merged
Merged
Conversation
Wire a self-serve password reset on top of Neon Auth (Better Auth): - "Forgot your password?" link on the sign-in form - /forgot-password: requestPasswordReset with redirectTo /reset-password; neutral "check your inbox" confirmation so it can't enumerate accounts - /reset-password: reads the one-time ?token, validates + confirms the new password, resetPassword; handles missing/invalid token up front All pages live in the public (marketing) group like /login; the proxy already rate-limits forget-password/reset-password. Neon Console side (trusted domain, shared email sender, email auth) already configured. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a self-serve password reset flow on top of Neon Auth (Better Auth).
/forgot-password/forgot-password— email field →authClient.requestPasswordReset({ email, redirectTo: <origin>/reset-password }). Always shows the same neutral "check your inbox" confirmation, so it can't be used to enumerate which accounts exist./reset-password— reads the one-time?tokenfrom the emailed link (useSearchParams, wrapped inSuspense), validates new password + confirmation, thenauthClient.resetPassword({ newPassword, token }). Handles missing/invalid token up front with a "request a new link" path.All pages live in the public
(marketing)route group alongside/loginand/signup. The/api/authproxy already rate-limitsforget-password/reset-password.Neon Console (already configured — no action needed)
https://petro-brain-web.vercel.apppresent; "Allow Localhost" onauth@mail.myneon.appactiveTest
/login→ "Forgot your password?" → enter a real account email → check inbox (peek spam first time) → click link → set new password on/reset-password→ sign in.Notes
auth@mail.myneon.app. Branding it to a PetroBrain domain (via the Webhooks toggle → Resend) is optional follow-up.tsc --noEmitand ESLint pass on the changed files.🤖 Generated with Claude Code